package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.sopmenu.SopMenuQuery;
import com.uzai.console.entity.SopMenu;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface SopMenuMapper {

    int deleteById(@Param("id") Long id);

    int deleteByMerIdAndCode(@Param("merId") Long merId, @Param("code") String code);

    int insert(SopMenu record);

    SopMenu selectById(@Param("id") Long id);

    SopMenu selectByMerIdAndCode(@Param("merId") Long merId, @Param("code") String code);

    int updateById(SopMenu record);

    /**
     * 分页查询
     *
     * @param page
     * @param query
     * @return
     */
    ArrayList<SopMenu> findByList(Page<SopMenu> page, @Param("query") SopMenuQuery query);

    /**
     * 查询所有
     *
     * @param query
     * @return
     */
    ArrayList<SopMenu> findByList(@Param("query") SopMenuQuery query);
}
